package com.fsnbigdata.service.impl;
import com.fsnbigdata.service.api.PropagationCultivationService;
import org.springframework.roo.addon.layers.service.annotations.RooServiceImpl;
import com.fsnbigdata.domain.PlantConservation;
import com.fsnbigdata.domain.PropagationCultivation;
import com.fsnbigdata.repository.PropagationCultivationRepository;
import io.springlets.data.domain.GlobalSearch;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * = PropagationCultivationServiceImpl
 *
 * TODO Auto-generated class documentation
 *
 */
@RooServiceImpl(service = PropagationCultivationService.class)
@Service
@Transactional(readOnly = true)
public class PropagationCultivationServiceImpl implements PropagationCultivationService {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    private PropagationCultivationRepository propagationCultivationRepository;

    /**
     * TODO Auto-generated constructor documentation
     *
     * @param propagationCultivationRepository
     */
    @Autowired
    public PropagationCultivationServiceImpl(PropagationCultivationRepository propagationCultivationRepository) {
        setPropagationCultivationRepository(propagationCultivationRepository);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return PropagationCultivationRepository
     */
    public PropagationCultivationRepository getPropagationCultivationRepository() {
        return propagationCultivationRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param propagationCultivationRepository
     */
    public void setPropagationCultivationRepository(PropagationCultivationRepository propagationCultivationRepository) {
        this.propagationCultivationRepository = propagationCultivationRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return PropagationCultivation
     */
    @Transactional
    public PropagationCultivation save(PropagationCultivation entity) {
        return getPropagationCultivationRepository().save(entity);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return PropagationCultivation
     */
    public PropagationCultivation findOne(Long id) {
        return getPropagationCultivationRepository().findOne(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return PropagationCultivation
     */
    public PropagationCultivation findOneForUpdate(Long id) {
        return getPropagationCultivationRepository().findOneDetached(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public List<PropagationCultivation> findAll(Iterable<Long> ids) {
        return getPropagationCultivationRepository().findAll(ids);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param plantConservation
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public Page<PropagationCultivation> findByPlantConservation(PlantConservation plantConservation, GlobalSearch globalSearch, Pageable pageable) {
        return getPropagationCultivationRepository().findByPlantConservation(plantConservation, globalSearch, pageable);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param plantConservation
     * @return Long
     */
    public long countByPlantConservation(PlantConservation plantConservation) {
        return getPropagationCultivationRepository().countByPlantConservation(plantConservation);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<PropagationCultivation> getEntityType() {
        return PropagationCultivation.class;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<Long> getIdType() {
        return Long.class;
    }
}
